<template>
  <div class="message">
    <van-nav-bar title="贺卡留言" left-text left-arrow @click-left="$router.go(-1)" />
    <textarea v-model="ordermessage" rows="8" cols="36" placeholder="请输入你的留言+署名"></textarea>
    <div class="savebtn" @click="message">保存</div>
  </div>
</template>
<style scoped>
.message {
  font-size: 0.16rem;
}
.message textarea {
  margin-top: 0.2rem;
  padding: 0.1rem 0.1rem;
  border: 0.01rem solid rgb(112, 110, 110);
}
.message .savebtn {
  width: 50%;
  height: 0.4rem;
  font-size: 0.18rem;
  background: #f85f34;
  border-radius: 0.2rem;
  margin: 0.2rem auto;
  line-height: 0.4rem;
  color: #fff;
}
</style>
<script>
import { mapState, mapMutations, mapAction } from "vuex";
export default {
  data() {
    return {
      ordermessage: ""
    };
  },
  methods: {
    ...mapMutations("product", ["saveMessage"]),
    message() {
      this.saveMessage({
        ordermessage: this.ordermessage
      });
      this.$router.push({ name: "SubmitOrder" });
    }
  }
};
</script>